#include <stdio.h>
#include "calculator.h"

int main() {
    int num1, num2;
    char operator;

    printf("Enter first number: ");
    scanf("%d", &num1);
    printf("Enter operator (+, -, *, /): ");
    scanf(" %c", &operator); // 注意前面的空格，用于消耗前面的换行符
    printf("Enter second number: ");
    scanf("%d", &num2);

    switch(operator) {
        case '+':
            printf("Result: %d\n", add(num1, num2));
            break;
        case '-':
            printf("Result: %d\n", subtract(num1, num2));
            break;
        case '*':
            printf("Result: %d\n", multiply(num1, num2));
            break;
        case '/':
            printf("Result: %d\n", divide(num1, num2));
            break;
        default:
            printf("Invalid operator.\n");
    }

    return 0;
}